package utils

// ConvertToInt64InterfaceSlice 将 []int64 转换为 []interface{}
func ConvertToInt64InterfaceSlice(slice []int64) []interface{} {
	result := make([]interface{}, len(slice))
	for i, v := range slice {
		result[i] = v
	}
	return result
}

// CollectNonZeroIds 收集非零的 id 到 map 中
func CollectNonZeroIds(id int64, idMap map[int64]struct{}) {
	if id != 0 {
		idMap[id] = struct{}{}
	}
}

// RemoveDuplicatesInt64Slice []int64 里面的元素去重
func RemoveDuplicatesInt64Slice(slice []int64) []int64 {
	seen := make(map[int64]struct{})
	var result []int64
	for _, value := range slice {
		if _, exists := seen[value]; !exists {
			seen[value] = struct{}{}
			result = append(result, value)
		}
	}
	return result
}
